import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;

import thriftGenerated.Req;
import thriftGenerated.myService;

/**
 * Created by dengpan on 2016/12/3.
 */
public class HelloTNoblockingClientDemo {
    public static void main(String[] args) {
        TTransport transport;
        try {
            transport = new TFramedTransport(new TSocket("localhost", 1234));
            TProtocol protocol = new TBinaryProtocol(transport);

            myService.Client client = new myService.Client(protocol);
            transport.open();

            for (int i = 0; i < 100000; i++) {
                Req req = new Req();
                req.setCount(12L);
                req.setName("nihao shi jie");
                client.getStudents(req);
            }

            transport.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
